package org.wesync.mosquito;

import java.util.Random;
import java.util.Scanner;

import org.wesync.mosquito.AePlayWave.Position;


public class Main {
	
	static float[] volume =  {0,0};

	public void static main(String[] args) throws InterruptedException 
	{
		int i =100;
		AePlayWave mug = new AePlayWave("Audio/mug.wav",Position.LEFT);
		AePlayWave mug2 = new AePlayWave("Audio/mug.wav",Position.RIGHT);
		mug.start();
		mug2.start();
		Random rand= new Random();
	
		
		while(true)
		{
			//volCalc(rand.nextInt(100));
			//Scanner in = new Scanner(System.in);
			//volCalc(in.nextInt());
			for(int n=10;n<90;n++)
				{volCalc(n);
			mug.setVolume(volume[0]);
			mug2.setVolume(volume[1]);
			i=i+15;		
			Thread.sleep(10);}
			for(int n=90;n>10;n--)
			{volCalc(n);
		mug.setVolume(volume[0]);
		mug2.setVolume(volume[1]);
		i=i-15;		
		Thread.sleep(10);}
		}
		
		
	}
	public static void volCalc(int posX)
	{
		volume[0]=(float) (Math.log10(100-posX)*20)-40;
		volume[1]=(float) (Math.log10(posX)*20)-40;
	}

}
